<div class="container-fluid maindiv">

	<div class="row-fluid">

	 	<div class="story_main_left_panel">
		<ul class="nav nav-list">
				<li class="nav-header">Statistics</li>
						
						<%= link_to('Go to statistics page', {:controller => 'statistics', :action => 'stories', :id => @story.id}, class: "btn btn-large btn-primary") %>

							<div >
							<!--<h3 class="story-page-text">Description:</h3>
							<div class="story-page-well">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget eros est, a auctor risus. Praesent id nisl leo. Sed mollis, ipsum et ornare vestibulum, mi tortor feugiat felis, a bibendum purus sapien a massa. Phasellus vel dolor nec justo eleifend porttitor vitae vitae eros. Phasellus a turpis metus. Integer eu est neque. Aenean lobortis, ante at pellentesque ullamcorper,</div>-->
						<li class="nav-header">Story Info</li>
							<div class="story-page-well"><% if !(@story.deleted || @story.hidden) %>
									<ul class="nav nav-list">
									<li class="nav-header">Status :</li>
									<span class="greenbadge">Active</span>
									</ul>
									<% elsif @story.deleted %>
									<ul class="nav nav-list">
									<li class="nav-header">Status</li>
									<li><span class="redbadge">Deleted</span></li>
									</ul>
									<% elsif @story.hidden %>
									<li><span class="yellowbadge">Hidden</span></li>
									<% end %>
									<li class="nav-header">Date :</li>
									<li><%= @story.created_at.to_date %></li>
									<li class="nav-header">Rank :</li>
									<li><%= @story.get_story_rank_all_time %></li>
									<li class="nav-header">Interest Name :</li>
									<li><%= Interest.find(@story.interest_id).name %></li>

							</div>
							<ul class="nav nav-list" >
							<li class="divider"></li>
							</ul>
							</div>
							<% if Story.find(params[:id]).hidden %>
            <%= link_to  "Unhide Stroy",{:controller => "stories", :action => "toggle_hiding"} ,:class => "btn btn-large btn-danger" %>
            <%else%>
            <%= link_to  "Hide Stroy",{:controller => "stories", :action => "toggle_hiding"} ,:class => "btn btn-large btn-warning" %>
            <%end%>
            </ul>
		</div>
				
			

			<div class="story_right_panel">
			<h1><%= @story.title %></h1>
			<ul class="nav nav-list" >
			<li class="divider"></li>
			</ul>
	

					<div class="story-body story-page-well">
					
					
<% if !(@story.content.nil? || @story.content=="") %>
					<div>
						<p><font size="5"><%=raw @story.content %></p>
					</div>		
<%else%>
<p><font size="3">No content</p>
<%end%>
					</div>
					<div class=body>
					<h2 class="story-identation story-page-text">Comments</h2>
					<ul class="nav nav-list story-identation" >
					<li class="divider"></li>
					</ul>
<div class="story-comments">
	<table class="table" >
		<% if !(@comments.nil? || @comments.empty?) %>
			<% @comments.each do |comment| %>
				<tr>
					<% if !(comment.deleted) %>
							<div class="comment-component-info">
								<% if !(User.find(comment.user_id).name.nil?) %>
									<td><h3><%= User.find(comment.user_id).name %> says: </h3></td>
								<% else %>
									<td><h3>(No name available)</h3</td>
								<% end %>
								<td><p><font size="4"><%= comment.content %></p></td>
								<td><span class="pull-right greenbadge">  Ups  (<%=comment.get_num_ups%>)</span>
									<span class="pull-right redbadge">Downs(<%=comment.get_num_downs%>)</span></td>
								<div id="delete">
									<% $source = "show" %>
									<td><%= link_to("X" , comment,{:controller => "comments", :method=>:delete, class: "btn btn-small btn-danger" }) %></td>
								</div>
							</div>
					<%end%>
				</tr>
			<%end%>
		<%else%>
				<p><font size="3">No comments</p>	
		<%end%>	
	</table>
</div>
					
			</div>
	</div>
</div>


